﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VPC.EX
{
    public enum etype { work, home, cell, fax };

    public class ContactEX
    {
        public WriterEX _wr;

        //Name
        public string _surname {get; set;}
        public string _given {get; set;}
        public string _additional {get; set;}
        public string _prefix {get; set;}
        public string _suffix {get; set;}

        //Function
        public string _fn {get; set;}

        //Organization
        public string _org {get; set;}

        //Title
        public string _title {get; set;}

        //Photo
        public string _photo {get; set;}

        //Phone
        public List<Phone> _phoneList = new List<Phone>();

        //Phone
        public List<Fax> _faxList = new List<Fax>();
    
        //Address
        public List<Address> _addrList = new List<Address>();

        //Email
        public List<string> _emailList = new List<string>();

        public ContactEX(string filename)
        {
            _wr = new WriterEX(filename);
        }

        public void addPhone(etype type, string num)
        {
            _phoneList.Add(new Phone(type, num));
        }

        public void addFax(etype type, string num)
        {
            _faxList.Add(new Fax(type, num));
        }

        public void addAddress(etype type, string street, string city, string code, string country)
        {
            _addrList.Add(new Address(type, street, city, code, country));
        }

        public void addEmail(string email)
        {
            _emailList.Add(email);
        }

        public void export()
        {
            _wr.export(this);
        }
    }

    public class Phone
    {
        public etype _phoneType {get; set;}
        public string _num { get; set; }

        public Phone(etype type, string num)
        {
            _phoneType = type;
            _num = num;
        }
    }

    public class Fax
    {
        public etype _phoneType { get; set; }
        public string _num { get; set; }

        public Fax(etype type, string num)
        {
            _phoneType = type;
            _num = num;
        }
    }

    public class Address
    {
        public etype _addrType { get; set; }
        public string _street { get; set; }
        public string _city { get; set; }
        public string _code { get; set; }
        public string _country { get; set; }

        public Address(etype type, string street, string city, string code, string country)
        {
            _addrType = type;
            _street = street;
            _city = city;
            _code = code;
            _country = country;
        }
    }
}
